<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>react-style</title>
    <script src="../node_modules/react/umd/react.development.js"></script>
    <script src="../node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="../node_modules/babel-standalone/babel.min.js"></script>

</head>
<body>
    <div id="my"></div>
    <script type="text/babel">

        var arr=[1,2,3,4,5];
        /*var div1 = [];
        for(var i=0;i<arr.length;i++){
            div1.push(<div key={i}>hello,{arr[i]}</div>)
        };
        */

        var style1 ={
            fontSize:'22px',
            color:'red'
        };

        var name='hanley';
        var ul = (
            <div>
                <div>123</div>
                <ul>
                    <li style={style1}>hello</li>
                    <li>{name}</li>
                </ul>
            </div>
        );
        //var div = React.createElement('div',{className:'div1'},222);
        // ReactDOM.render(
        //     ul,
        //     document.getElementById('my')
        // );

         ReactDOM.render(
            <div>
                {
                    arr.map(function(item,index){
                    return <div key={index}>hello,{item}</div>
                    })
                }
            </div>,
        document.getElementById('my')
    )
    </script>
</body>
</html>